package com.cole.gx095.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "stockgoods")
public class Stockgoods {
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name = "Id")
    private int id;
    @Basic
    @Column(name = "ContractId")
    private Integer contractId;
    @Basic
    @Column(name = "ContractNum")
    private String contractNum;
    @Basic
    @Column(name = "BillId")
    private Integer billId;
    @Basic
    @Column(name = "BillNum")
    private String billNum;
    @Basic
    @CreatedDate
    @Column(name = "CreateDate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp createDate;
    /**
     * 品名
     */
    @Basic
    @Column(name = "TypeName")
    private String typeName;
    @Basic
    @Column(name = "GoodsName")
    private String goodsName;
    /**
     * 型号
     */
    @Basic
    @Column(name = "Modle")
    private String modle;
    /**
     * 关联数量
     */
    @Basic
    @Column(name = "CorrelationAccount")
    private Integer correlationAccount;
    /**
     * 剩余数量
     */
    @Basic
    @Column(name = "RemainAccount")
    private Integer remainAccount;
    /**
     * 商品总数
     */
    @Basic
    @Column(name = "GoodsAccount")
    private Integer goodsAccount;
    @Basic
    @Column(name = "GoodsUnitPrice")
    private Double goodsUnitPrice;
    @Basic
    @Column(name = "GoodsSumPrice")
    private Double goodsSumPrice;
    @Basic
    @Column(name = "Remakes")
    private String remakes;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Integer getContractId() {
        return contractId;
    }

    public void setContractId(Integer contractId) {
        this.contractId = contractId;
    }

    public String getContractNum() {
        return contractNum;
    }

    public void setContractNum(String contractNum) {
        this.contractNum = contractNum;
    }

    public Integer getBillId() {
        return billId;
    }

    public void setBillId(Integer billId) {
        this.billId = billId;
    }

    public String getBillNum() {
        return billNum;
    }

    public void setBillNum(String billNum) {
        this.billNum = billNum;
    }

    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getModle() {
        return modle;
    }

    public void setModle(String modle) {
        this.modle = modle;
    }

    public Integer getCorrelationAccount() {
        return correlationAccount;
    }

    public void setCorrelationAccount(Integer correlationAccount) {
        this.correlationAccount = correlationAccount;
    }

    public Integer getRemainAccount() {
        return remainAccount;
    }

    public void setRemainAccount(Integer remainAccount) {
        this.remainAccount = remainAccount;
    }

    public Integer getGoodsAccount() {
        return goodsAccount;
    }

    public void setGoodsAccount(Integer goodsAccount) {
        this.goodsAccount = goodsAccount;
    }

    public Double getGoodsUnitPrice() {
        return goodsUnitPrice;
    }

    public void setGoodsUnitPrice(Double goodsUnitPrice) {
        this.goodsUnitPrice = goodsUnitPrice;
    }

    public Double getGoodsSumPrice() {
        return goodsSumPrice;
    }

    public void setGoodsSumPrice(Double goodsSumPrice) {
        this.goodsSumPrice = goodsSumPrice;
    }

    public String getRemakes() {
        return remakes;
    }

    public void setRemakes(String remakes) {
        this.remakes = remakes;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Stockgoods that = (Stockgoods) o;
        return id == that.id && Objects.equals(contractId, that.contractId) && Objects.equals(contractNum, that.contractNum) && Objects.equals(billId, that.billId) && Objects.equals(billNum, that.billNum) && Objects.equals(createDate, that.createDate) && Objects.equals(typeName, that.typeName) && Objects.equals(goodsName, that.goodsName) && Objects.equals(modle, that.modle) && Objects.equals(correlationAccount, that.correlationAccount) && Objects.equals(remainAccount, that.remainAccount) && Objects.equals(goodsAccount, that.goodsAccount) && Objects.equals(goodsUnitPrice, that.goodsUnitPrice) && Objects.equals(goodsSumPrice, that.goodsSumPrice) && Objects.equals(remakes, that.remakes);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, contractId, contractNum, billId, billNum, createDate, typeName, goodsName, modle, correlationAccount, remainAccount, goodsAccount, goodsUnitPrice, goodsSumPrice, remakes);
    }
}
